package com.situ.tos2024.dao;

import com.situ.tos2024.model.OrderDetail;
import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 功能：
 *
 * @author 千堆雪
 * @version 1.0.0
 * @since 2024/4/10
 * <p>
 * created by 千堆雪 on 2024/4/10 10:41, last modified by 千堆雪 on 2024/4/10 10:41
 */
@Mapper
public interface OrderDetailDAO {
    //查询全部
    List<OrderDetail> findAll(OrderDetailSearch search);

    //根据订单主键查询
    List<OrderDetail> findByOrderId(Integer orderId);

    //根据订单编号查询
    default List<OrderDetail> findByOrderNo(String orderNo) {
        OrderDetailSearch search = new OrderDetailSearch();
        search.setOrderNo(orderNo);
        return findAll(search);
    }

    @Getter
    @Setter
    class OrderDetailSearch extends OrderDetail {
        private String orderNo;
    }
}




